﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HalconDotNet;
using AssemblyCYG.Tcp通讯;

namespace AssemblyCYG
{
    public static class ShareData
    {
        public static string strSNCode = "";
        public static string strCoilCode = "";

        public static string configPath = System.Environment.CurrentDirectory + "\\config.cfg";
        public static CINIFactory calParaIni = null;
        public static double calMoveStep = 0;       //相机单独标定时移动的步距
        public static double calRotateStep = 0;     //相机单独标定时旋转的步距
        //相机的像素当量
        public static double downCamPixSize_X = 0;   //下相机在x轴方向的像元尺寸
        public static double downCamPixSize_Y = 0;
        public static double downCamPixSize_Phi = 0;
        public static double upCamPixSize1_Y = 0;
        public static double upCamPixSize2_Y = 0;
        public static double reviewPixSize_Y = 0;
        //关联标定时产品位置
        public static double dowCamStandPos_X = 0;    //下相机在关联标定时的标准位置
        public static double dowCamStandPos_Y = 0;
        public static double dowCamStandPos_Phi = 0;
        public static double dowCamStandPos2_X = 0;    //下相机在关联标定时的标准位置
        public static double dowCamStandPos2_Y = 0;
        public static double dowCamStandPos2_Phi = 0;
        public static double upCamStandPos1_X = 0;
        public static double upCamStandPos1_Y = 0;
        public static double upCamStandPos1_Phi = 0;
        public static double upCamStandPos2_X = 0;
        public static double upCamStandPos2_Y = 0;
        public static double upCamStandPos2_Phi = 0;
        //像素当量
        public static double downCamPixSize = 0;
        public static double upCamPixSize1 = 0;
        public static double upCamPixSize2 = 0;
        //吸嘴的旋转中心
        public static double rotateCenter_X = 0;
        public static double rotateCenter_Y = 0;

        public static HKCameral MvsCameral = new HKCameral();         //初始化海康相机
        //public static ModbusTCP tcpClient = new ModbusTCP();          //初始化tcp通讯

        public static MitsubishiTCP tcpMitsubishiTCP = new MitsubishiTCP();
        public static List<int> cameralOpenList = new List<int>();    //判断相机是否启动，用于软件关闭时关闭相机
        public static ItemType projectItem;
        public static string loginPassword;   //管理员登陆密码

        public static bool isRepet = false;
        public enum ItemType
        {
            手动线组装,
            自动线spring组装,
            自动线coil组装,
            coil半自动线,
            spring自检,
            coil自检,
            spring胶形检测,
            coil胶形检测
        }
    }
    public class saveImageInfo
    {
        public HObject saveImage;
        public string savePath;
        public int saveFormat;        //保存格式
    }
}
